<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.1">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon32.ico">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon16.ico">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">
  <link rel="stylesheet" href="/lib/pace/pace-theme-flat-top.min.css">
  <script src="/lib/pace/pace.min.js"></script>

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"example.com","root":"/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":-1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="最近，开始接触Arduino平台，我认为造轮子的是提高代码能力的最有效的方式。  造轮子：简明来说就是重新实现已有的功能，以达到更高效、更稳定等的目的  以下程序例程来自太极创客官网，此平台的Arduino教程深入浅出，对于想学习Arduino的同学，首推太极创客团队。">
<meta property="og:type" content="article">
<meta property="og:title" content="🚗造轮子—MeArm">
<meta property="og:url" content="http://example.com/2022/03/03/%E9%80%A0%E8%BD%AE%E5%AD%90%E2%80%94MeArm/index.html">
<meta property="og:site_name" content="Redamancy785&#39;s Blog">
<meta property="og:description" content="最近，开始接触Arduino平台，我认为造轮子的是提高代码能力的最有效的方式。  造轮子：简明来说就是重新实现已有的功能，以达到更高效、更稳定等的目的  以下程序例程来自太极创客官网，此平台的Arduino教程深入浅出，对于想学习Arduino的同学，首推太极创客团队。">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2022-03-03T08:24:13.000Z">
<meta property="article:modified_time" content="2022-03-09T07:24:41.778Z">
<meta property="article:author" content="Redamancy785">
<meta property="article:tag" content="Arduino">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="http://example.com/2022/03/03/%E9%80%A0%E8%BD%AE%E5%AD%90%E2%80%94MeArm/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>🚗造轮子—MeArm | Redamancy785's Blog</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>


    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">Redamancy785's Blog</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">在不动声色的日子里,遇见你真好</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
	  <a target="_blank" rel="noopener" href="https://github.com/happymrli" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2022/03/03/%E9%80%A0%E8%BD%AE%E5%AD%90%E2%80%94MeArm/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="https://sf3-cdn-tos.toutiaostatic.com/img/user-avatar/32da60bc0440a8f7022acf22d74df3ac~300x300.image">
      <meta itemprop="name" content="Redamancy785">
      <meta itemprop="description" content="野生钢铁侠">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Redamancy785's Blog">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          🚗造轮子—MeArm
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2022-03-03 16:24:13" itemprop="dateCreated datePublished" datetime="2022-03-03T16:24:13+08:00">2022-03-03</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2022-03-09 15:24:41" itemprop="dateModified" datetime="2022-03-09T15:24:41+08:00">2022-03-09</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E5%AD%A6%E4%B9%A0/" itemprop="url" rel="index"><span itemprop="name">学习</span></a>
                </span>
            </span>

          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2022/03/03/%E9%80%A0%E8%BD%AE%E5%AD%90%E2%80%94MeArm/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2022/03/03/%E9%80%A0%E8%BD%AE%E5%AD%90%E2%80%94MeArm/" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="本文字数">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">本文字数：</span>
              <span>7k</span>
            </span>
            <span class="post-meta-item" title="阅读时长">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              <span>6 分钟</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p>最近，开始接触<code>Arduino</code>平台，我认为<code>造轮子</code>的是提高代码能力的最有效的方式。</p>
<blockquote>
<p>造轮子：简明来说就是重新实现已有的功能，以达到更高效、更稳定等的目的</p>
</blockquote>
<p>以下程序例程来自<a target="_blank" rel="noopener" href="http://www.taichi-maker.com/">太极创客官网</a>，此平台的Arduino教程深入浅出，对于想学习Arduino的同学，首推太极创客团队。</p>
<span id="more"></span>

<p>以下便是今天练习的造轮子程序：</p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br><span class="line">232</span><br><span class="line">233</span><br><span class="line">234</span><br><span class="line">235</span><br><span class="line">236</span><br><span class="line">237</span><br><span class="line">238</span><br><span class="line">239</span><br><span class="line">240</span><br><span class="line">241</span><br><span class="line">242</span><br><span class="line">243</span><br><span class="line">244</span><br><span class="line">245</span><br><span class="line">246</span><br><span class="line">247</span><br><span class="line">248</span><br><span class="line">249</span><br><span class="line">250</span><br><span class="line">251</span><br><span class="line">252</span><br><span class="line">253</span><br><span class="line">254</span><br><span class="line">255</span><br><span class="line">256</span><br><span class="line">257</span><br><span class="line">258</span><br><span class="line">259</span><br><span class="line">260</span><br><span class="line">261</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// Joy——MeArm</span></span><br><span class="line"></span><br><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment">MeArm机械臂控制程序</span></span><br><span class="line"><span class="comment">机械臂的控制有两种模式，分别为：</span></span><br><span class="line"><span class="comment">指令模式；在串口中输入格式为“ b90 ”的数据，控制“ base ”舵机运转到“ 90° ”位置；</span></span><br><span class="line"><span class="comment">按键模式：在串口中输入wsad/8456,控制机械臂的自由运动。</span></span><br><span class="line"><span class="comment">两种模式可以通过&#x27;m&#x27;字符切换。</span></span><br><span class="line"><span class="comment">*/</span></span><br><span class="line"></span><br><span class="line"><span class="meta">#<span class="keyword">include</span> <span class="string">&lt;Servo.h&gt;</span>            <span class="comment">//导入Servo库</span></span></span><br><span class="line">Servo base, rArm, fArm, claw; <span class="comment">//创建四个Servo对象</span></span><br><span class="line"></span><br><span class="line"><span class="comment">//存储电机极限值——使用const关键字</span></span><br><span class="line"><span class="type">const</span> <span class="type">int</span> baseMIn = <span class="number">0</span>;</span><br><span class="line"><span class="type">const</span> <span class="type">int</span> baseMax = <span class="number">180</span>;</span><br><span class="line"><span class="type">const</span> <span class="type">int</span> rArmMIn = <span class="number">45</span>;</span><br><span class="line"><span class="type">const</span> <span class="type">int</span> rArmMax = <span class="number">180</span>;</span><br><span class="line"><span class="type">const</span> <span class="type">int</span> fArmMIn = <span class="number">3</span>;</span><br><span class="line"><span class="type">const</span> <span class="type">int</span> fArmMax = <span class="number">120</span>;</span><br><span class="line"><span class="type">const</span> <span class="type">int</span> clawMIn = <span class="number">25</span>;</span><br><span class="line"><span class="type">const</span> <span class="type">int</span> clawMax = <span class="number">100</span>;</span><br><span class="line"></span><br><span class="line"><span class="type">int</span> DSD = <span class="number">15</span>;     <span class="comment">//DSD——Default Servo Delay</span></span><br><span class="line"><span class="type">bool</span> mode = <span class="literal">true</span>; <span class="comment">//mode=1 指令模式  mode=0 按键模式</span></span><br><span class="line"><span class="type">int</span> moveStep = <span class="number">3</span>; <span class="comment">//每一次按下按键 舵机的移动量</span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="type">void</span> <span class="title">setup</span><span class="params">()</span> </span>&#123;       <span class="comment">//初始化内容包括：伺服电机连接PWM、伺服电机初始化、串口初始化</span></span><br><span class="line">    base.<span class="built_in">attach</span>(<span class="number">11</span>); <span class="comment">//base 伺服舵机连接引脚11 舵机代号&#x27;b&#x27;</span></span><br><span class="line">    <span class="built_in">delay</span>(<span class="number">200</span>);      <span class="comment">//稳定性等待</span></span><br><span class="line">    rArm.<span class="built_in">attach</span>(<span class="number">10</span>); <span class="comment">//rArm 伺服舵机连接引脚10 舵机代号&#x27;r&#x27;</span></span><br><span class="line">    <span class="built_in">delay</span>(<span class="number">200</span>);      <span class="comment">//稳定性等待</span></span><br><span class="line">    fArm.<span class="built_in">attach</span>(<span class="number">9</span>);  <span class="comment">//fArm 伺服舵机连接引脚9 舵机代号&#x27;f&#x27;</span></span><br><span class="line">    <span class="built_in">delay</span>(<span class="number">200</span>);      <span class="comment">//稳定性等待</span></span><br><span class="line">    claw.<span class="built_in">attach</span>(<span class="number">6</span>);  <span class="comment">//claw 伺服舵机连接引脚6 舵机代号&#x27;c&#x27;</span></span><br><span class="line">    <span class="built_in">delay</span>(<span class="number">200</span>);      <span class="comment">//稳定性等待  </span></span><br><span class="line">    </span><br><span class="line">    base.<span class="built_in">write</span>(<span class="number">90</span>);</span><br><span class="line">    <span class="built_in">delay</span>(<span class="number">10</span>);</span><br><span class="line">    rArm.<span class="built_in">write</span>(<span class="number">90</span>);</span><br><span class="line">    <span class="built_in">delay</span>(<span class="number">10</span>);</span><br><span class="line">    fArm.<span class="built_in">write</span>(<span class="number">90</span>);</span><br><span class="line">    <span class="built_in">delay</span>(<span class="number">10</span>);</span><br><span class="line">    claw.<span class="built_in">write</span>(<span class="number">90</span>);</span><br><span class="line">    <span class="built_in">delay</span>(<span class="number">10</span>);</span><br><span class="line">    </span><br><span class="line">    Serial.<span class="built_in">begin</span>(<span class="number">9600</span>);</span><br><span class="line">    Serial.<span class="built_in">println</span>(<span class="string">&quot;Ths is MeArm!&quot;</span>); </span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="type">void</span> <span class="title">loop</span><span class="params">()</span> </span>&#123;                   <span class="comment">//反复读取串口数据</span></span><br><span class="line">    <span class="keyword">if</span> (Serial.<span class="built_in">available</span>()&gt;<span class="number">0</span>) &#123; <span class="comment">//如果串口有数据输入</span></span><br><span class="line">        <span class="type">char</span> serialCmd = Serial.<span class="built_in">read</span>();</span><br><span class="line">        <span class="keyword">if</span> (mode) &#123;</span><br><span class="line">            <span class="built_in">armDataCmd</span>(serialCmd);</span><br><span class="line">        &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">            <span class="built_in">armJoyCmd</span>(serialCmd);      </span><br><span class="line">        &#125;</span><br><span class="line">    &#125;   </span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">//五个子函数</span></span><br><span class="line"><span class="function"><span class="type">void</span> <span class="title">armDataCmd</span><span class="params">(<span class="type">char</span> seerialCmd)</span> </span>&#123; <span class="comment">//指令模式</span></span><br><span class="line">    <span class="keyword">if</span>(serialCmd == <span class="string">&#x27;w&#x27;</span> || serialCmd == <span class="string">&#x27;s&#x27;</span> || serialCmd == <span class="string">&#x27;a&#x27;</span> || </span><br><span class="line">      serialCmd == <span class="string">&#x27;d&#x27;</span> || serialCmd == <span class="string">&#x27;8&#x27;</span> || serialCmd == <span class="string">&#x27;5&#x27;</span> || </span><br><span class="line">      serialCmd == <span class="string">&#x27;4&#x27;</span> || serialCmd == <span class="string">&#x27;6&#x27;</span>)&#123;</span><br><span class="line">        Serial.<span class="built_in">println</span>(<span class="string">&quot;+Warning: Robot in Instruction Mode...&quot;</span>);</span><br><span class="line">        <span class="built_in">delay</span>(<span class="number">100</span>);</span><br><span class="line">        <span class="keyword">while</span>(Serial.<span class="built_in">available</span>()&gt;<span class="number">0</span>) <span class="type">char</span> wrongCommand = Serial.<span class="built_in">read</span>();</span><br><span class="line">        <span class="keyword">return</span>;</span><br><span class="line">    &#125;</span><br><span class="line">    </span><br><span class="line">    <span class="keyword">if</span>(serialCmd == <span class="string">&#x27;b&#x27;</span> || serialCmd == <span class="string">&#x27;r&#x27;</span> || serialCmd == <span class="string">&#x27;f&#x27;</span> || </span><br><span class="line">      serialCmd == <span class="string">&#x27;c&#x27;</span>) &#123;</span><br><span class="line">        <span class="type">int</span> servoData = Serial.<span class="built_in">parseInt</span>();</span><br><span class="line">        <span class="built_in">servoCmd</span>(servoCmd, servoData, DSD);</span><br><span class="line">    &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">        <span class="keyword">switch</span> (serialCmd)&#123;</span><br><span class="line">			<span class="keyword">case</span> <span class="string">&#x27;m&#x27;</span> :   <span class="comment">//切换至手柄模式 </span></span><br><span class="line">      			mode = <span class="number">0</span>; </span><br><span class="line">        		Serial.<span class="built_in">println</span>(<span class="string">&quot;Command: Switch to Joy Mode.&quot;</span>);</span><br><span class="line">       		    <span class="keyword">break</span>;</span><br><span class="line">            <span class="keyword">case</span> <span class="string">&#x27;o&#x27;</span>:</span><br><span class="line">                <span class="built_in">reportStatus</span>();</span><br><span class="line">                <span class="keyword">break</span>;</span><br><span class="line">            <span class="keyword">case</span> <span class="string">&#x27;i:</span></span><br><span class="line"><span class="string">                armIniPos();</span></span><br><span class="line"><span class="string">                break;                </span></span><br><span class="line"><span class="string">            default:</span></span><br><span class="line"><span class="string">                Serial.println(&quot;Unknown Command.&quot;);     </span></span><br><span class="line"><span class="string">        &#125;</span></span><br><span class="line"><span class="string">    &#125;</span></span><br><span class="line"><span class="string"> </span></span><br><span class="line"><span class="string">&#125;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">void armJoyCmd(char serialCmd) &#123; // 按键模式</span></span><br><span class="line"><span class="string">    if(serialCmd == &#x27;</span>b<span class="number">&#x27;</span> || serialCmd == <span class="string">&#x27;r&#x27;</span> ||</span><br><span class="line">       serialCmd == <span class="string">&#x27;f&#x27;</span> || serialCmd == <span class="string">&#x27;c&#x27;</span> )&#123;</span><br><span class="line">        Serial.<span class="built_in">println</span>(<span class="string">&quot;+Warning: Robot in Joy Mode...&quot;</span>);</span><br><span class="line">        <span class="built_in">delay</span>(<span class="number">100</span>);</span><br><span class="line">        <span class="keyword">while</span>(Serial.<span class="built_in">available</span>()&gt;<span class="number">0</span>) <span class="type">char</span> wrongCommand = Serial.<span class="built_in">read</span>();</span><br><span class="line">        <span class="keyword">return</span>;</span><br><span class="line">    &#125;</span><br><span class="line">    </span><br><span class="line">    <span class="type">int</span> baseJoyPos;</span><br><span class="line">    <span class="type">int</span> rArmJoyPos;</span><br><span class="line">    <span class="type">int</span> fArmJoyPos;</span><br><span class="line">    <span class="type">int</span> clawJoyPos;</span><br><span class="line">    <span class="keyword">switch</span>(serialCmd)&#123;</span><br><span class="line">        <span class="keyword">case</span> <span class="string">&#x27;a&#x27;</span>:</span><br><span class="line">            Serial.<span class="built_in">println</span>(<span class="string">&quot;Receive Command : Base turn Left&quot;</span>);</span><br><span class="line">            baseJoyPos = base.<span class="built_in">read</span>() - moveStep;</span><br><span class="line">            <span class="built_in">servoCmd</span>(<span class="string">&#x27;b&#x27;</span>, baseJoyPos, DSD);</span><br><span class="line">            <span class="keyword">break</span>;</span><br><span class="line">        <span class="keyword">case</span> <span class="string">&#x27;d&#x27;</span>:</span><br><span class="line">            Serial.<span class="built_in">println</span>(<span class="string">&quot;Receive Command : Base turn Left&quot;</span>);</span><br><span class="line">            baseJoyPos = base.<span class="built_in">read</span>() + moveStep;</span><br><span class="line">            <span class="built_in">servoCmd</span>(<span class="string">&#x27;b&#x27;</span>, baseJoyPos, DSD);</span><br><span class="line">            <span class="keyword">break</span>;            </span><br><span class="line">        <span class="keyword">case</span> <span class="string">&#x27;w&#x27;</span>:</span><br><span class="line">            Serial.<span class="built_in">println</span>(<span class="string">&quot;Receive Command : Base turn Left&quot;</span>);</span><br><span class="line">            baseJoyPos = rArm.<span class="built_in">read</span>() + moveStep;</span><br><span class="line">            <span class="built_in">servoCmd</span>(<span class="string">&#x27;r&#x27;</span>, baseJoyPos, DSD);</span><br><span class="line">            <span class="keyword">break</span>;</span><br><span class="line">        <span class="keyword">case</span> <span class="string">&#x27;s&#x27;</span>:</span><br><span class="line">            Serial.<span class="built_in">println</span>(<span class="string">&quot;Receive Command : Base turn Left&quot;</span>);</span><br><span class="line">            baseJoyPos = rArm.<span class="built_in">read</span>() - moveStep;</span><br><span class="line">            <span class="built_in">servoCmd</span>(<span class="string">&#x27;r&#x27;</span>, baseJoyPos, DSD);</span><br><span class="line">            <span class="keyword">break</span>;            </span><br><span class="line">        <span class="keyword">case</span> <span class="string">&#x27;4&#x27;</span>:</span><br><span class="line">            Serial.<span class="built_in">println</span>(<span class="string">&quot;Receive Command : Base turn Left&quot;</span>);</span><br><span class="line">            baseJoyPos = claw.<span class="built_in">read</span>() - moveStep;</span><br><span class="line">            <span class="built_in">servoCmd</span>(<span class="string">&#x27;c&#x27;</span>, baseJoyPos, DSD);</span><br><span class="line">            <span class="keyword">break</span>;</span><br><span class="line">        <span class="keyword">case</span> <span class="string">&#x27;6&#x27;</span>:</span><br><span class="line">            Serial.<span class="built_in">println</span>(<span class="string">&quot;Receive Command : Base turn Left&quot;</span>);</span><br><span class="line">            baseJoyPos = claw.<span class="built_in">read</span>() + moveStep;</span><br><span class="line">            <span class="built_in">servoCmd</span>(<span class="string">&#x27;c&#x27;</span>, baseJoyPos, DSD);</span><br><span class="line">            <span class="keyword">break</span>;            </span><br><span class="line">        <span class="keyword">case</span> <span class="string">&#x27;8&#x27;</span>:</span><br><span class="line">            Serial.<span class="built_in">println</span>(<span class="string">&quot;Receive Command : Base turn Left&quot;</span>);</span><br><span class="line">            baseJoyPos = fArm.<span class="built_in">read</span>() + moveStep;</span><br><span class="line">            <span class="built_in">servoCmd</span>(<span class="string">&#x27;f&#x27;</span>, baseJoyPos, DSD);</span><br><span class="line">            <span class="keyword">break</span>;</span><br><span class="line">        <span class="keyword">case</span> <span class="string">&#x27;5&#x27;</span>:</span><br><span class="line">            Serial.<span class="built_in">println</span>(<span class="string">&quot;Receive Command : Base turn Left&quot;</span>);</span><br><span class="line">            baseJoyPos = fArm.<span class="built_in">read</span>() - moveStep;</span><br><span class="line">            <span class="built_in">servoCmd</span>(fr<span class="number">&#x27;</span>, baseJoyPos, DSD);</span><br><span class="line">            <span class="keyword">break</span>;            </span><br><span class="line">		<span class="keyword">case</span> <span class="string">&#x27;m&#x27;</span> :   <span class="comment">//切换至指令模式 </span></span><br><span class="line">      		mode = <span class="number">0</span>; </span><br><span class="line">        	Serial.<span class="built_in">println</span>(<span class="string">&quot;Command: Switch to Instruction Mode.&quot;</span>);</span><br><span class="line">       		<span class="keyword">break</span>;</span><br><span class="line">        <span class="keyword">case</span> <span class="string">&#x27;o&#x27;</span>:</span><br><span class="line">            <span class="built_in">reportStatus</span>();</span><br><span class="line">            <span class="keyword">break</span>;</span><br><span class="line">        <span class="keyword">case</span> <span class="string">&#x27;i:</span></span><br><span class="line"><span class="string">            armIniPos();</span></span><br><span class="line"><span class="string">            break;                </span></span><br><span class="line"><span class="string">        default:</span></span><br><span class="line"><span class="string">            Serial.println(&quot;Unknown Command.&quot;);            </span></span><br><span class="line"><span class="string">    &#125;</span></span><br><span class="line"><span class="string"> </span></span><br><span class="line"><span class="string">&#125;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">void servoCmd(char servoName, int toPos, int servoDelay) &#123; //???</span></span><br><span class="line"><span class="string">    Servo servo2go;</span></span><br><span class="line"><span class="string">    //串口监视器输出接受指令信息</span></span><br><span class="line"><span class="string">    Serial.println(&quot;&quot;);</span></span><br><span class="line"><span class="string">    Serial.print(&quot;+Command: Servo &quot;);    </span></span><br><span class="line"><span class="string">    Serial.print(servoName);</span></span><br><span class="line"><span class="string">    Serial.print(&quot; to &quot;);</span></span><br><span class="line"><span class="string">    Serial.print(toPos);</span></span><br><span class="line"><span class="string">    Serial.print(&quot; at servoDelay value &quot;);</span></span><br><span class="line"><span class="string">    Serial.print(servoDelay);</span></span><br><span class="line"><span class="string">    Serial.println(&quot;.&quot;);</span></span><br><span class="line"><span class="string">    </span></span><br><span class="line"><span class="string">    int fromPos;</span></span><br><span class="line"><span class="string">    </span></span><br><span class="line"><span class="string">    switch (servoName) &#123;</span></span><br><span class="line"><span class="string">        case &#x27;</span>b<span class="number">&#x27;</span>:</span><br><span class="line">            <span class="keyword">if</span>(toPos &gt;= baseMin &amp;&amp; toPos &lt;= baseMax) &#123;</span><br><span class="line">                servo2fo = base;</span><br><span class="line">                fromPos = base.<span class="built_in">read</span>(); <span class="comment">//获取当前电机角度值</span></span><br><span class="line">                <span class="keyword">break</span>;</span><br><span class="line">            &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">                Serial.<span class="built_in">println</span>(<span class="string">&quot;+Warning: base Servo Value Out Of Limit!&quot;</span>);</span><br><span class="line">                <span class="keyword">return</span>; </span><br><span class="line">            &#125;</span><br><span class="line">            </span><br><span class="line">        <span class="keyword">case</span> <span class="string">&#x27;r&#x27;</span>:</span><br><span class="line">            <span class="keyword">if</span>(toPos &gt;= rArmMin &amp;&amp; toPos &lt;= rArmMax) &#123;</span><br><span class="line">                servo2fo = rArm;</span><br><span class="line">                fromPos = rArm.<span class="built_in">read</span>(); <span class="comment">//获取当前电机角度值</span></span><br><span class="line">                <span class="keyword">break</span>;</span><br><span class="line">            &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">                Serial.<span class="built_in">println</span>(<span class="string">&quot;+Warning: rArm Servo Value Out Of Limit!&quot;</span>);</span><br><span class="line">                <span class="keyword">return</span>;</span><br><span class="line">            &#125;</span><br><span class="line"> </span><br><span class="line">            <span class="keyword">if</span>(toPos &gt;= fArmMin &amp;&amp; toPos &lt;= fArmMax) &#123;</span><br><span class="line">                servo2fo = fArm;</span><br><span class="line">                fromPos = fArm.<span class="built_in">read</span>(); <span class="comment">//获取当前电机角度值</span></span><br><span class="line">                <span class="keyword">break</span>;</span><br><span class="line">            &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">                Serial.<span class="built_in">println</span>(<span class="string">&quot;+Warning: fArm Servo Value Out Of Limit!&quot;</span>);</span><br><span class="line">                <span class="keyword">return</span>;</span><br><span class="line">            &#125;</span><br><span class="line">            </span><br><span class="line">            <span class="keyword">if</span>(toPos &gt;= clawMin &amp;&amp; toPos &lt;= clawMax) &#123;</span><br><span class="line">                servo2fo = claw;</span><br><span class="line">                fromPos = claw.<span class="built_in">read</span>(); <span class="comment">//获取当前电机角度值</span></span><br><span class="line">                <span class="keyword">break</span>;</span><br><span class="line">            &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">                Serial.<span class="built_in">println</span>(<span class="string">&quot;+Warning: claw Servo Value Out Of Limit!&quot;</span>);</span><br><span class="line">                <span class="keyword">return</span>;</span><br><span class="line">            &#125;                                </span><br><span class="line">    &#125;</span><br><span class="line">    </span><br><span class="line">	</span><br><span class="line">	<span class="comment">//指挥电机运行</span></span><br><span class="line">    <span class="keyword">if</span>(fromPos &lt;= toPos) &#123;</span><br><span class="line">        <span class="keyword">for</span>(<span class="type">int</span> i=fromPos; i&lt;=toPos; i++) &#123;</span><br><span class="line">       		servo2go.<span class="built_in">write</span>(i);  </span><br><span class="line">            <span class="built_in">delay</span>(servoDelay);</span><br><span class="line">        &#125; </span><br><span class="line">    &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">        <span class="keyword">for</span>(<span class="type">int</span> i=fromPos; i&gt;=toPos; i--) &#123;</span><br><span class="line">       		servo2go.<span class="built_in">write</span>(i);  </span><br><span class="line">            <span class="built_in">delay</span>(servoDelay);</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;       </span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="type">void</span> <span class="title">reportStatus</span><span class="params">()</span> </span>&#123; <span class="comment">//显示当前状态</span></span><br><span class="line">    Serial.<span class="built_in">println</span>(<span class="string">&quot;&quot;</span>);</span><br><span class="line">    Serial.<span class="built_in">println</span>(<span class="string">&quot;&quot;</span>);</span><br><span class="line">    Serial.<span class="built_in">println</span>(<span class="string">&quot;+ MeArm Status Report +&quot;</span>);</span><br><span class="line">    Serial.<span class="built_in">print</span>(<span class="string">&quot;Base Position: &quot;</span>); Serial.<span class="built_in">println</span>(base.<span class="built_in">read</span>());</span><br><span class="line">    Serial.<span class="built_in">print</span>(<span class="string">&quot;Rear Arm Position: &quot;</span>); Serial.<span class="built_in">println</span>(rArm.<span class="built_in">read</span>());</span><br><span class="line">    Serial.<span class="built_in">print</span>(<span class="string">&quot;Front Arm Position: &quot;</span>); Serial.<span class="built_in">println</span>(fArm.<span class="built_in">read</span>());</span><br><span class="line">    Serial.<span class="built_in">print</span>(<span class="string">&quot;Claw Position: &quot;</span>); Serial.<span class="built_in">println</span>(claw.<span class="built_in">read</span>());</span><br><span class="line">    Serial.<span class="built_in">println</span>(<span class="string">&quot;++++++++++++++++++++++++++&quot;</span>);</span><br><span class="line">    Serial.<span class="built_in">println</span>(<span class="string">&quot;&quot;</span>);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="type">void</span> <span class="title">armIniPos</span><span class="params">()</span> </span>&#123; <span class="comment">//初始化舵机位置</span></span><br><span class="line">    Serial.<span class="built_in">println</span>(<span class="string">&quot;+Command: Restore Initial Position.&quot;</span>);</span><br><span class="line">    <span class="type">int</span> robotIniPosArray[<span class="number">4</span>][<span class="number">3</span>] = &#123;</span><br><span class="line">        &#123;<span class="string">&#x27;b&#x27;</span>, <span class="number">90</span>, DSD&#125;,</span><br><span class="line">        &#123;<span class="string">&#x27;r&#x27;</span>, <span class="number">90</span>, DSD&#125;,</span><br><span class="line">        &#123;<span class="string">&#x27;f&#x27;</span>, <span class="number">90</span>, DSD&#125;,</span><br><span class="line">        &#123;<span class="string">&#x27;c&#x27;</span>, <span class="number">90</span>, DSD&#125;,</span><br><span class="line">    &#125;;</span><br><span class="line">     <span class="keyword">for</span> (<span class="type">int</span> i=<span class="number">0</span>; i&lt;<span class="number">4</span>; i++) &#123;</span><br><span class="line">         <span class="built_in">servoCmd</span>(robotIniPosArray[i][<span class="number">0</span>],</span><br><span class="line">                  robotIniPosArray[i][<span class="number">1</span>], </span><br><span class="line">                  robotIniPosArray[i][<span class="number">2</span>],</span><br><span class="line">                  robotIniPosArray[i][<span class="number">3</span>]);</span><br><span class="line">     &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>




    </div>

    
    
    
        <div class="reward-container">
  <div>我不管，我要吃棒棒糖~</div>
  <button onclick="var qr = document.getElementById('qr'); qr.style.display = (qr.style.display === 'none') ? 'block' : 'none';">
    打赏
  </button>
  <div id="qr" style="display: none;">
      
      <div style="display: inline-block;">
        <img src="/images/weixin.jpg" alt="Redamancy785 微信支付">
        <p>微信支付</p>
      </div>
      
      <div style="display: inline-block;">
        <img src="/images/zhifubao.jpg" alt="Redamancy785 支付宝">
        <p>支付宝</p>
      </div>

  </div>
</div>


      <footer class="post-footer">
          
          <div class="post-tags">
              <a href="/tags/Arduino/" rel="tag"><i class="fa fa-tag"></i> Arduino</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2022/02/27/%E5%85%AC%E5%91%8A/" rel="prev" title="来啦！">
      <i class="fa fa-chevron-left"></i> 来啦！
    </a></div>
      <div class="post-nav-item">
    <a href="/2022/03/06/%E4%BA%91%E7%AB%AF%E5%9B%BE%E5%BA%93/" rel="next" title="云端图库">
      云端图库 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          
    <div class="comments" id="valine-comments"></div>

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="Redamancy785"
      src="https://sf3-cdn-tos.toutiaostatic.com/img/user-avatar/32da60bc0440a8f7022acf22d74df3ac~300x300.image">
  <p class="site-author-name" itemprop="name">Redamancy785</p>
  <div class="site-description" itemprop="description">野生钢铁侠</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">9</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">3</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">4</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/happymrli" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;happymrli" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://weibo.com/u/7464024291" title="Weibo → https:&#x2F;&#x2F;weibo.com&#x2F;u&#x2F;7464024291" rel="noopener" target="_blank"><i class="fab fa-weibo fa-fw"></i>Weibo</a>
      </span>
  </div>


  <div class="links-of-blogroll motion-element">
    <div class="links-of-blogroll-title"><i class="fa fa-link fa-fw"></i>
      Links
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <a href="https://space.bilibili.com/629004933" title="https:&#x2F;&#x2F;space.bilibili.com&#x2F;629004933" rel="noopener" target="_blank">Bilibili</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://me.csdn.net/weixin_51460407" title="https:&#x2F;&#x2F;me.csdn.net&#x2F;weixin_51460407" rel="noopener" target="_blank">CSDN</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://www.toutiao.com/c/user/token/MS4wLjABAAAATetYsKx5ltYrGCleC17q6YEveJEd18RvhE4Qpylwm9KbjXThfi_M337_48X95DBn" title="https:&#x2F;&#x2F;www.toutiao.com&#x2F;c&#x2F;user&#x2F;token&#x2F;MS4wLjABAAAATetYsKx5ltYrGCleC17q6YEveJEd18RvhE4Qpylwm9KbjXThfi_M337_48X95DBn" rel="noopener" target="_blank">今日头条</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://mrli123456789.github.io/" title="https:&#x2F;&#x2F;mrli123456789.github.io&#x2F;" rel="noopener" target="_blank">野生钢铁侠の知识库</a>
        </li>
    </ul>
  </div>

      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-[object Object]"></i>
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Redamancy785</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-area"></i>
    </span>
    <span title="站点总字数">14k</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
    <span title="站点阅读时长">13 分钟</span>
</div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script size="300" alpha="0.6" zIndex="-1" src="/lib/canvas-ribbon/canvas-ribbon.js"></script>
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  




  
<script src="/js/local-search.js"></script>













  

  


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el         : '#valine-comments',
      verify     : false,
      notify     : false,
      appId      : 'a2cwDaNdJ6fps0LaWYNPVQKA-gzGzoHsz',
      appKey     : 'hiUU3Wae5NCzTgAwMYGuk0b1',
      placeholder: "发一条友善的评论",
      avatar     : 'mm',
      meta       : guest,
      pageSize   : '10' || 10,
      visitor    : false,
      lang       : '' || 'zh-cn',
      path       : location.pathname,
      recordIP   : false,
      serverURLs : ''
    });
  }, window.Valine);
});
</script>

</body>
</html>
